#include <stdio.h>
#include "hotel.h"

int menu(void)
{
	int code, status;

	printf("\n%s%s\n",STARS, STARS);
	printf("Enter the num of the desired hotel:\n");
	printf("1)Fairfield Arms\t2)Hotel olympic\n");
	printf("3)Cherteorthy Plaza\t2)The Stockton\n");
	printf("5)quit\n");

	while ((status=scanf("%d",&code))!=1 ||(code<1||code>5))
	{
		if (status != 1)
		{
			scanf("%*s");
		}
		printf("The num is among from 1 to 5.\n");
	}
	return code;
}

int getnights(void)
{
	int night;

	printf("How many nights are needed?\n");
	while	(scanf("%d",&night)!=1)
	{
		scanf("%*s");
		printf(" Please enter an integer, such as 2.\n");
	}
	return night;
}

void showprice(double rate, int nights)
{
	int n;
	double total =0.0;
	double factor =1.0;

	for (n = 1; n <= nights; n++, factor *= DISCOUNT)
	{
		total +=rate*factor;
	}
	printf("THe total cost will be $%0.2f.\n", total);
}